package com.ruoyi.project.cms.document.service.impl;

import com.ruoyi.project.cms.document.domain.ZzDocument;
import com.ruoyi.project.cms.document.mapper.ZzDocumentMapper;
import com.ruoyi.project.cms.document.service.DocumentService;
import com.ruoyi.project.cms.role.domain.SysRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 公司:
 * 作者:胖虎
 * 类名:DocumentServiceImpl
 * 描述:
 * 时间:2020-05-21
 */

@Service
public class DocumentServiceImpl  implements DocumentService {


    @Autowired
    private ZzDocumentMapper  documentMapper;

    /**
     * 文档查询
     * @param document
     * @return
     */
    @Override
    public List<ZzDocument> selectDocumentList(ZzDocument document) {
        return documentMapper.selectDocumentList(document);
    }


    /**
     * 添加文档
     * @param document
     * @return
     */
    @Override
    public int insertDocument(ZzDocument document) {
        return documentMapper.insertDocument(document);
    }


    /**
     * 根据id查文档
     * @param docId
     * @return
     */
    @Override
    public ZzDocument selectDeptById(Integer  docId) {
        return documentMapper.selectByPrimaryKey(docId);
    }


    /**
     * 修改文档
     * @param document
     * @return
     */
    @Override
    public int updateDocument(ZzDocument document) {
        return documentMapper.updateDocument(document);
    }


    /**
     * 删除文档
     * @param ids
     * @return
     */
    @Override
    public int deleteDocumentByIds(String ids) {
        return   documentMapper.deleteByPrimaryKey(ids);
    }
}
